import React from "react";
import actions from "../store/actions/counter";
import { connect } from "react-redux";

class Counter extends React.Component {
  render() {
    return (
      <div>
        <p>{this.props.number}</p>
        <button onClick={this.props.add}>+</button>
        <button onClick={this.props.asyncAdd}>asyncAdd</button>
        <button onClick={this.props.minus}>-</button>
        <button onClick={this.props.asyncMinus}>asyncMinus</button>
      </div>
    );
  }
}
let mapStateToProps = (state) => ({ ...state });
let mapDispatchToProps = actions;
export default connect(mapStateToProps, mapDispatchToProps)(Counter);
